package com.qianxun.watchdog;

import com.qianxun.watchdog.communication.CommunicationService;

import java.io.IOException;

/**
 *
 * @author: huwei
 * @date: 2020/10/19 11:18
 * @version: 1.0.0
 */
public class ApplicationBootstrapper {

    public static void main(String[] args) throws Exception {

        Watchdog watchdog = new Watchdog();
        try {
            CommunicationService.run(20259,watchdog.getMessageHandler()
                    ,()->{
                        System.out.println("startup error ,exit");
                        System.exit(0);
                    });
        } catch (IOException e) {
            System.out.println("startup error ,exit");
            System.exit(0);
        }

        System.out.println("watchdog startup success ");
    }
}
